package com.zyx.spring5msb.aoptx.dao;

import com.zyx.spring5msb.aoptx.entity.Emp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * @author Yaxi.Zhang
 * @since 2021/9/29 15:12
 */
@Repository
public class EmpDao {
    @Autowired
    JdbcTemplate jdbcTemplate;

    public void save(Emp emp) {
        String sql = "insert into emp(empno,ename) values(?,?)";
        int update = jdbcTemplate.update(sql, emp.getEmpno(), emp.getEname());
        System.out.println(update);
    }

}
